package com.along.htybrowser.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 资源实体
 *
 * @author wen66to88@163.com
 * @date 2021/7/6 - 10:43
 */
public class ResourcesBean implements Parcelable {
    private String url;
    private boolean isIntercept;//拦截

    public ResourcesBean(String url, boolean isIntercept) {
        this.url = url;
        this.isIntercept = isIntercept;
    }

    protected ResourcesBean(Parcel in) {
        url = in.readString();
        isIntercept = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(url);
        dest.writeByte((byte) (isIntercept ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ResourcesBean> CREATOR = new Creator<ResourcesBean>() {
        @Override
        public ResourcesBean createFromParcel(Parcel in) {
            return new ResourcesBean(in);
        }

        @Override
        public ResourcesBean[] newArray(int size) {
            return new ResourcesBean[size];
        }
    };

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isIntercept() {
        return isIntercept;
    }

    public void setIntercept(boolean intercept) {
        isIntercept = intercept;
    }

    @Override
    public String toString() {
        return "ResourcesBean{" +
                "url='" + url + '\'' +
                ", isIntercept=" + isIntercept +
                '}';
    }
}
